//
//  WaterFlowLayout.h
//  DebugDemo
//
//  Created by XFB on 2019/6/29.
//  Copyright © 2019 ZhouCheng. All rights reserved.
//

#import <UIKit/UIKit.h>

@class WaterFlowLayout;
@protocol WaterFlowLayoutDelegate <NSObject>

@required;
- (CGFloat)waterFlowLayout:(WaterFlowLayout *_Nullable)waterFlowLayout
                 itemWidth:(CGFloat)itemWidth
                 indexPath:(NSIndexPath *_Nonnull)indexPath;

@end


NS_ASSUME_NONNULL_BEGIN

@interface WaterFlowLayout : UICollectionViewLayout

/**  列数  */
@property (nonatomic, assign) NSInteger columnCount;
/**  行间距  */
@property (nonatomic, assign) CGFloat rowSpacing;
/**  列间距  */
@property (nonatomic, assign) CGFloat columnSpacing;
/**  内边距  */
@property (nonatomic, assign) UIEdgeInsets sectionInset;

/**  WaterFlowLayoutDelegate  */
@property (nonatomic, weak) id <WaterFlowLayoutDelegate> delegate;

#pragma mark --- 配置方法
- (void)setColumnSpacing:(NSInteger)columnSpacing
              rowSpacing:(NSInteger)rowSpacing
            sectionInset:(UIEdgeInsets)sectionInset;

#pragma mark --- 构造方法
- (instancetype)initWithColumnCount:(NSInteger)columnCount;
+ (instancetype)waterFlowLayoutWithColumnCount:(NSInteger)columnCount;

@end

NS_ASSUME_NONNULL_END
